const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let ObjectId = Schema.Types.ObjectId;

// 创建工厂表
const factorySchema = new Schema({
  id: {type: ObjectId},//类别id
  name: {unique: true,type: String},//类别名
  desciption: String, //厂家描述
  contact: String,//联系方式
  origin: String,//产地
  createAt: {type: Date, default: Date.now},//生成时间
})

mongoose.model('Factory',factorySchema);
